Microscopes and other optical systems need be focused on the object or the structure which the system reproduces. For a system which scans an object, continuous refocusing operations are necessary since the object is seldom planar. For instance, a height variation by some tenths of a micrometer of the object is sufficient for the object to get into the outer edge of the depth of focus of a high-resolution light-optical microscope objective if no refocusing takes place. A microscope slide has greater height variations than that and, besides, the preparation has variations in respect of thickness as well as position in the vertical direction, and the object holding mechanism does not allow movements of the object which are perfectly perpendicular to the optical axis of the system. Therefore automatic scanning microscopes must be equipped with an automatic focusing system.
The purpose of an automatic focusing system can be said to reside in the steps of somehow measuring the current focus, deciding on a focus correction in respect of sign as well as amount, and carrying out the correction which, for example, results in a raising or lowering of the objective relative to the object.
A focusing system must satisfy many requirements. The system can be assessed, among other things, according to how good a focus it achieves, how robust it is relative to different kinds of objects, how rapidly it achieves focus, how cost effective it is to manufacture and maintain and what demands it places on the surroundings in the form of, for instance, space and power requirements.
The measurement of focus can be carried out actively or passively. An example of active measurement is utilization of infrared light reflected by the object, like in some automatically focusing still cameras. An example of passive measurement is utilization of the contents of the images from an image sensor. The image sensor can be the image sensor existing in a microscope or an image sensor which is used only to measure focus. The drawbacks of adding optics and one or more sensors in a parallel measuring system are first an increasing system complexity, expenses and space requirements, second several non-ideal components in the optical beam path, and third the need for calibrating the position of the measuring system for optimal focus relative to the same of the useful, existing sensor.
Only passive focus systems will be discussed in the following. On the basis of images from one or more image sensors, the focus system should thus set a focus which in some sense is optimal. Normally, an optimal focus is defined as the focus which is experienced by a specific individual to be optimal for the application at issue. To be able to decide which is the optimal focus, the focus system uses a so-called focus measure. The focus measure is a function used to calculate a series of scalar focus values for different focus positions. It is applied to an entire image or a partial image from a sensor to obtain a focus value for each image/partial image. If the focus measure functions well, it has a maximum (or minimum) at the desired best focus. An example of a traditional focus measure is the sample variance of the intensity values in an image, where the sample variance is defined as
                                          V            ⁡                          (                              A                k                            )                                =                                    1                              (                                  mn                  -                  1                                )                                      ⁢                                          ∑                                  i                  =                  1                                m                            ⁢                                                          ⁢                                                ∑                                      j                    =                    1                                    n                                ⁢                                                                  ⁢                                                      a                    ~                                    ijk                  2                                                                    ,                            (                  Equ          .                                          ⁢          1                )            wherein
                                                        a              ~                        ijk                    =                                    a              ijk                        -                                          1                mn                            ⁢                                                ∑                                      i                    =                    1                                    m                                ⁢                                                                  ⁢                                                      ∑                                          j                      =                      1                                        n                                    ⁢                                      a                    ijk                                                                                      ,                            (                  Equ          .                                          ⁢          2                )            i.e. the image adjusted to the sample mean value zero.
For the traditional focus measures, the peak value depends on the detailed contents of the image and is therefore not known in advance. It is thus not possible to decide on the basis of a single such focus value how great a physical focus correction is required to reach the position for the best focus. Since each value, except the peak value, can arise on both sides of the peak, it is also not possible to decide on the basis of a single such focus value on which side of the peak the image is taken. To maximize the value of a traditional focus measure, some kind of search is therefore necessary.
When images from one sensor only are used, the search will take long since the focus measure must be evaluated for a number of different physical positions of the objective. The traditional focus measures do not provide directional information, which further causes the first search step to be a step in the wrong direction in 50% of the cases.
A system having a plurality of sensors which are arranged in several image planes can more rapidly find its way with the useful sensor to the maximum of the focus measure. One reason for the time saving is that for each physical position of the objective, images corresponding to a plurality of focus positions will be obtained—one for each image plane. The search can therefore be effected with fewer physical positions of the objective.
An example of such a focus system with a plurality of sensors is disclosed in U.S. Pat. No. 5,912,699. In this system, the sign of the focus correction is determined by means of a standardized difference of the focus measures from two additional image sensors which have image planes above and below the useful image sensor. The standardized difference serves as a qualitative measure indicating whether it is necessary to focus further and, if so, in which direction.
Summing up, there are at least two problems caused by the prior art-technique of automatic focusing, viz. on the one hand the fact that a focus measure does not always yield a peak for optimal focus and, on the other hand, the fact that a plurality of images from different focus positions of the objective are necessary to find the optimal focus.